﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Vtron.HipcConfigurationTools.VWASStyle
{
    /// <summary>
    /// 板卡类型转换为元素显示状态
    /// </summary>
    public class BoardTypeToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return Visibility.Collapsed;
            }
            return value.ToString() == "编码板" ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return parameter;
        }
    }
}
